export function sleep(numberMillis) {
    var now = new Date();
    var exitTime = now.getTime() + numberMillis;
    while (true) {
        now = new Date();
        if (now.getTime() > exitTime) {
            return;
        }
    }
}


export function GetUniqueID() {
    // 当前时间转成 36 进制字符串
    var time = Date.now().toString(36)

    // 当前随机数转成 36 进制字符串
    var random = Math.random().toString(36)

    // 去除随机数的 0. 字符串
    random = random.substring(2, random.length)

    // 返回唯一ID
    return random + time
}

export function Mobile(arr, i, num) {
    arr.splice(i, 0, arr.splice(i + num, 1)[0])
    return arr
}

export function TableRowClassName({row, rowIndex,}) {
    if (rowIndex === 1) {
        return 'warning-row'
    } else if (rowIndex === 3) {
        return 'success-row'
    }
    return ''
}